package org.dromara.system.service;

import org.dromara.system.common.UploadFiles;
import org.dromara.system.domain.BusinessFileRel;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
* @author chs
* @description 针对表【business_file_rel(业务附件表)】的数据库操作Service
* @createDate 2025-02-10 15:30:49
*/
public interface BusinessFileRelService extends IService<BusinessFileRel> {


    //根据业务id与业务标识查询文件信息
    List<BusinessFileRel> fileMesSelect(Long businessId);

    /**
     * 根据业务id，业务表标识，文件集合保存业务附件信息
     * @param businessId 业务表id
     * @param businessTable 业务表标识
     * @param files 文件集合
     */
    Boolean fileMesSave(Long businessId, String businessTable, List<UploadFiles> files);



    /**
     * 根据业务表id删除业务附件信息
     * @param businessIds 业务表id
     * @param businessTable 业务表标识
     * @return
     */
    Boolean fileMesDelete(List<Long> businessIds, String businessTable);

    /**
     *
     * @param businessId
     * @param businessTable
     * @return
     */
    Boolean fileMesDelete(Long businessId, String businessTable);

    /**
     * 删除指定业务id的多个附件
     * @param: businessId 业务id
     * @param: businessTable 业务标识
     * @param: fileIds 附件id
     * @return: boolean
     * @author CHS
     * @date: 2024/7/25 14:05
     */
    Boolean fileMesDeleteByBusinessIdAndFileIds(Long businessId,String businessTable,List<Long> fileIds);

    /**
     * 根据业务表id与业务表标识查询业务附件信息
     * @param businessId
     * @param businessTable
     * @return
     */
    List<UploadFiles> fileMesList(Long businessId, String businessTable);

    /**
     * 根据业务表id集合与业务表标识查询业务附件信息
     * @param businessIds 业务表id集合
     * @param businessTable 业务表标识
     * @return
     */
    Map<Long, List<UploadFiles>> fileMesListByIds(List<Long> businessIds, String businessTable);

}
